#ifndef DISPLAY_H
#define DISPLAY_H

#include <allegro5/allegro.h>
#include <allegro5/allegro_native_dialog.h>
#include <allegro5/allegro_primitives.h>
#include <allegro5/allegro_font.h>
#include <allegro5/allegro_ttf.h>

#include <boost/smart_ptr.hpp>
using boost::scoped_ptr;
using boost::shared_ptr;

#include "Globals.h"

/*! \class Display
 *  \brief Initialises Allegro display and display events and fonts
 *
 *  \author Jackline Atsango
 *  \author Jean pierre vieira Pereira
 *  \version 3
 *  \date 27 September 2012
 */

using namespace std;

class Display
{
    public:

/*! \fn Display
 *  \brief create Display object
 */
        Display();

/*! \fn ALLEGRO_DISPLAY* get_display
 *  \returns pointer to the Allegro display
 */
        ALLEGRO_DISPLAY* get_display();

/*! \fn ALLEGRO_DISPLAY* get_event_queue
 *  \returns pointer to the Allegro event queue
 */
        ALLEGRO_EVENT_QUEUE* get_event_queue();

/*! \fn void start_timer
 *  \brief Allegro function to start the timer
 */
        void start_timer();

/*! \fn void update
 *  \brief update the main display from the back buffer
 */
        void update();

/*! \fn ALLEGRO_FONT* get_font18
 *  \returns pointer to user defined font of size 18
 */
        ALLEGRO_FONT* get_font18();

/*! \fn ALLEGRO_FONT* get_font36
 *  \returns pointer to user defined font of size 36
 */
        ALLEGRO_FONT* get_font36();

/*! \fn ALLEGRO_FONT* get_font144
 *  \returns pointer to user defined font of size 144
 */
        ALLEGRO_FONT* get_font144();

/*! \fn virtual ~Display
 *  \brief detroys the fonts, display, timer and event queue
 *  using allegro functions
 */
        virtual ~Display();

/*! \fn float get_current_time
 *  \returns current time using allegro al_current_time()
 */
        float get_current_time();

    private:

        void load_font18();
        void load_font36();
        void load_font144();

        ALLEGRO_DISPLAY *_display;
        ALLEGRO_EVENT_QUEUE *_event_queue;
        ALLEGRO_TIMER *_timer;

        ALLEGRO_FONT *_font18;
        ALLEGRO_FONT *_font36;
        ALLEGRO_FONT *_font144;

        int _FPS;

};

#endif // DISPLAY_H
